import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)



const routes = [
  {
    path: '/',
    name: 'home',
    redirect:'home',
    component: ()=>import('../views/ManagerView.vue'),
    children:[
      {path:'home',name:'Home',component:()=>import('../views/HomeView.vue')},
      {path:'novels',name:'Novels',component:()=>import('../views/NovelsView.vue')},
      {path:'novel',name:'Novel',component:()=>import('../views/NovelView.vue')},
      {path:'shuoshuo',name:'ShuoShuo',component:()=>import('../views/EmotionView.vue')},
      {path:'message',name:'Message',component:()=>import('../views/MessageView.vue')},
      {path:'image',name:'Image',component:()=>import('../views/ImageView.vue')},
      {path:'person',name:'Person',component:()=>import('../views/PersonView.vue')},
    ]
  },
]


const router = new VueRouter({
  routes
})

router.afterEach((to, from, next) => {
  console.log(to,from,next)
  window.scrollTo(0, 0)
})

export default router
